package com.cy.air.postXml.view
{
	import com.cy.air.postXml.ApplicationFacade;
	import com.cy.air.postXml.view.components.RequestUrlView;
	import com.cy.air.postXml.view.components.RequestXmlView;
	
	import flash.events.Event;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.patterns.mediator.Mediator;

	public class RequestXmlMediator extends Mediator implements IMediator
	{
		public static const NAME:String="requestXmlMediator";
		
		public function RequestXmlMediator(view:RequestXmlView)
		{
			super(NAME,view);
			view.addEventListener(RequestXmlView.SEND_XML,onSendXml);
		}
		
		private function onSendXml(e:Event):void{
			sendNotification(ApplicationFacade.SEND_XML,requestXmlView.requestText);
		}
		
		public function get requestXmlView():RequestXmlView
		{
			return viewComponent as RequestXmlView;
		}
	}
}